<?xml version="1.0" encoding="utf-8" ?>
<Content type="xform" name="Billing Address">
  <model>
    <instance>
		<tblCartContact type="Billing Address">
			<nContactKey/>
			<nContactDirId/>
			<nContactCartId/>
			<cContactType>Billing Address</cContactType>
			<cContactName/>
			<cContactCompany/>
			<cContactAddress/>
			<cContactTown/>
			<cContactCity/>
			<cContactState/>
			<cContactZip/>
			<cContactCountry/>
			<cContactTel/>
			<cContactFax/>
			<cContactEmail/>
      <cContactXml>
        <OptIn />
      </cContactXml>
			<nAuditId/>
			<nAuditKey/>
			<dPublishDate/>
			<dExpireDate/>
			<dInsertDate/>
			<nInsertDirId/>
			<dUpdateDate/>
			<nUpdateDirId/>
			<nStatus>0</nStatus>
			<cDescription/>
		</tblCartContact>
		<tblCartContact type="Delivery Address">
			<nContactKey/>
			<nContactDirId/>
			<nContactCartId/>
			<cContactType>Delivery Address</cContactType>
			<cContactName/>
			<cContactCompany/>
			<cContactAddress/>
			<cContactTown/>
			<cContactCity/>
			<cContactState/>
			<cContactZip/>
			<cContactCountry/>
			<cContactTel/>
			<cContactFax/>
			<cContactEmail/>
      <cContactXml/>
			<nAuditId/>
			<nAuditKey/>
			<dPublishDate/>
			<dExpireDate/>
			<dInsertDate/>
			<nInsertDirId/>
			<dUpdateDate/>
			<nUpdateDirId/>
			<nStatus>0</nStatus>
			<cDescription/>
		</tblCartContact>
      <cartCmd/>
      <cIsDelivery>false</cIsDelivery>
    </instance>
    <submission id="contact" action="" method="POST" event="return form_check(this);" />
	  <bind id="cartCmd" nodeset="cartCmd" required="false()" type="string" />

	  <bind nodeset="tblCartContact[@type='Billing Address']">
		<bind id="cContactType" nodeset="cContactType" required="false()" type="string" />
		<bind id="cContactName" nodeset="cContactName" required="true()" type="string" />
		<bind id="cContactCompany" nodeset="cContactCompany" required="false()" type="string" />
		<bind id="cContactAddress" nodeset="cContactAddress" required="true()" type="string" />
		<bind id="cContactCity" nodeset="cContactCity" required="true()" type="string" />
		<bind id="cContactState" nodeset="cContactState" required="false()" type="string" />
		<bind id="cContactZip" nodeset="cContactZip" required="true()" type="string" />
		<bind id="cContactCountry" nodeset="cContactCountry" required="true()" type="string" />
		<bind id="cContactTel" nodeset="cContactTel" required="true()" type="string" />
		<bind id="cContactFax" nodeset="cContactFax" required="false()" type="string" />
		<bind id="cContactEmail" nodeset="cContactEmail" required="true()" type="email" />
      <bind nodeset="cContactXml">
        <bind id="cContactOpt-In" nodeset="OptIn" required="false()" type="string" />
      </bind>
	  </bind>
	  <bind nodeset="tblCartContact[@type='Delivery Address']">
		  <bind id="cDelContactType" nodeset="cContactType" required="false()" type="string" />
		  <bind id="cDelContactName" nodeset="cContactName" required="true()" type="string" />
		  <bind id="cDelContactCompany" nodeset="cContactCompany" required="false()" type="string" />
		  <bind id="cDelContactAddress" nodeset="cContactAddress" required="true()" type="string" />
		  <bind id="cDelContactCity" nodeset="cContactCity" required="true()" type="string" />
		  <bind id="cDelContactState" nodeset="cContactState" required="false()" type="string" />
		  <bind id="cDelContactZip" nodeset="cContactZip" required="true()" type="string" />
		  <bind id="cDelContactCountry" nodeset="cContactCountry" required="true()" type="string" />
		  <bind id="cDelContactTel" nodeset="cContactTel" required="true()" type="string" />
		  <bind id="cDelContactFax" nodeset="cContactFax" required="false()" type="string" />
	  </bind>
    <bind id="cIsDelivery" nodeset="cIsDelivery" required="false()" type="string" />
  </model>
	<group>
		<group  class="2col">
			<!--<label>Your Address Details</label>-->
			<group ref="address">
				<label>Billing address</label>
				<input bind="cartCmd" class="hidden">
					<label>cartCmd</label>
				</input>
				<input bind="cContactType" class="hidden">
					<label>Type</label>
					<value>Billing Address</value>
				</input>
				<input bind="cContactName" class="textbox required">
					<label>Name</label>
					<value />
				</input>      
				<input bind="cContactAddress" class="textbox required">
					<label>Address</label>
					<value />
				</input>
				<input bind="cContactCity" class="textbox required">
					<label>Town/City</label>
					<value />
				</input>
				<input bind="cContactState" class="textbox">
					<label>County</label>
					<value />
				</input>
				<input bind="cContactZip" class="textbox required">
          <label>Postcode</label>
          <value />
        </input>
				<select1 bind="cContactCountry" class="dropdown country required" appearance="minimal">
					<label>Country</label>
				</select1>
				<input bind="cContactTel" class="textbox required">
					<label>Tel</label>
					<value />
				</input>
				<input bind="cContactEmail" class="textbox required">
					<label>Email</label>
					<value />
				</input>
			</group>
			<group ref="address">
				<label>Delivery address (if different)</label>
				<select bind="cIsDelivery" appearance="full">
					<item>
            <label>Deliver to different address</label>
            <value>true</value>
					</item>
				</select>
				<input bind="cDelContactType" class="hidden">
					<label>Type</label>
					<value>Delivery Address</value>
				</input>
				<input bind="cDelContactName" class="textbox required">
					<label>Name</label>
					<value />
				</input>      
				<input bind="cDelContactAddress" class="textbox required">
					<label>Address</label>
					<value />
				</input>
				<input bind="cDelContactCity" class="textbox required">
					<label>Town/City</label>
					<value />
				</input>
				<input bind="cDelContactState" class="textbox">
					<label>County</label>
					<value />
				</input>
				 <input bind="cDelContactZip" class="textbox required">
          <label>Postcode</label>
          <value />
        </input>
				<select1 bind="cDelContactCountry" class="dropdown country required" appearance="minimal">
					<label>Country</label>
				</select1>
				<input bind="cDelContactTel" class="textbox required">
					<label>Tel</label>
					<value />
				</input>
			</group>
		</group>  
		<submit submission="SubmitAdd" ref="cartBillAddress" class="principle">
			<label>Continue</label>
		</submit>
	</group>

</Content>
